package com.wjjun.base.ui.state

import androidx.databinding.ObservableField
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.flexbox.AlignItems
import com.google.android.flexbox.FlexDirection
import com.google.android.flexbox.FlexWrap
import com.google.android.flexbox.JustifyContent

/**
 * RecycleView的UI设置
 * author : wangjunjun
 * date   : 2022/7/1
 * desc   :
 */
class RecycleViewState {

    //是否可以下拉刷新
    val enableRefresh = ObservableField(false)

    //是否可以上拉加载
    val enableLoadMore = ObservableField(false)

    //方向
    val orientation = ObservableField(RecyclerView.VERTICAL)

    //item动画
    var itemAnimator = ObservableField<RecyclerView.ItemAnimator>()

    //是否没有更多数据
    val noMoreData = ObservableField(true)

    //是否可以拖动
    val drag = ObservableField(false)

    //网格布局使用
    val spanCount = ObservableField(3)

    val spanSizeLookup = ObservableField<GridLayoutManager.SpanSizeLookup>()

    //流式布局使用
    //决定主轴项目排列方向
    val flexDirection = ObservableField(FlexDirection.ROW)

    //换行
    val flexWrap = ObservableField(FlexWrap.WRAP)

    //主轴上的对齐方式
    val justifyContent = ObservableField(JustifyContent.FLEX_START)

    //副轴轴上如何对齐
    val alignItems = ObservableField(AlignItems.FLEX_START)
}